<!-- 其他检查记录 -->

<template>
	<div>
		<table-no-height
			:dataSource="dataSource"
			:tableColumns="tableColumns"
			:height="500"
		></table-no-height>
	</div>
</template>

<script>
	import tableNoHeight from "@/components/customComponents/customeTable/tableNoHeight"
	import { AjaxCommon } from "@/libs/apiCommon"
	import { PopupCommon } from "@/libs/popupCommon"
	export default {
		props: ["userInfo", "type", "isFirst"],
		components: {
			tableNoHeight,
		},
		data() {
			return {
				dataSource: [],
				tableColumns: [
          {
            prop: "checkTime",
            label: "检查时间",
            width: 160,
          },
					{
						prop: "checkItemName",
						label: "检查名称",
						width: 100,
					},
					{
						prop: "checkItemExplain",
						label: "检查说明",
						width: 120,
					},
					{
						prop: "checkItemResult",
						label: "检查结果",
						width: 80,
					},
					{
						prop: "createByName",
						label: "检查人",
						width: 80,
					},
          {
            prop: "createByName",
            label: "记录时间",
            width: 160,
          },
				],
			}
		},
		methods: {
			// 初始化事件
			initPage() {
				let self = this
				let url =
					this.type == "filter"
						? "/ccdc/pm/em/filter/emFilterOther/listByPage"
						: "/ccdc/pm/em/in/emInOtherCheck/listByPage"
				// 这里的isFirst 不一定是boolen类型
				let first = this.isFirst ? true : false
				AjaxCommon(
					url,
					"post",
					{
            examineeCodes: [self.userInfo.examineeCode],
						pageNo: 1,
						pageSize: 1000,
					},
					first
				).then((res) => {
					if (res.data.code == 200) {
						self.dataSource = res.data.result.records
						self.pageCount = res.data.result.total
					} else {
						PopupCommon.notify("error", res.data.message)
					}
				})
			},
		},
		mounted() {
			this.initPage()
		},
	}
</script>
